package com.gongj.openfeign.controller;

import com.gongj.openfeign.client.BankClient;
import com.gongj.openfeign.dto.BankInfoDTO;
import com.gongj.openfeign.dto.BankInfoDTO;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BankController {

    @Autowired
    private BankClient bankClient;
    @GetMapping
    public String saveBankInfo(){
        BankInfoDTO bankDTO = new BankInfoDTO();
        bankDTO.setName("gongj");
        return bankClient.saveBankInfo(bankDTO);
    }

    @GetMapping("/getInfo")
    public String getInfo(){

        return bankClient.getInfo("gongj");
    }
}
